﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta content="" name="description" />
    <meta content="JiangZhiYong" name="author" />
    <title>用户管理</title>
	<!-- Bootstrap Styles-->
	<#assign ctx=(rc.getContextPath())!''>
    <link href="${ctx}/assets/css/bootstrap.css" rel="stylesheet" />
     <!-- FontAwesome Styles-->
    <link href="${ctx}/assets/css/font-awesome.css" rel="stylesheet" />
     <!-- Morris Chart Styles-->
   
    <!-- Custom Styles-->
    <link href="${ctx}/assets/css/custom-styles.css" rel="stylesheet" />
     <!-- Google Fonts-->
   <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
     <!-- TABLE STYLES-->
    <link href="${ctx}/assets/js/dataTables/dataTables.bootstrap.css" rel="stylesheet" />
    <link rel="shortcut icon" href="${ctx}/assets/img/favicon.png">
</head>
<body>
    <div id="wrapper">
      	
      	<#include "/common/nav-top.html"/>
        <!--/. NAV TOP  -->
        
        
      <#include "*/common/nav-left.html"/>
        <!-- /. NAV SIDE  -->
      	
       <div id="page-wrapper" >
		  <div class="header"> 
              <h1 class="page-header">
                 	 用户管理 <small>用户查询，帮手设置...</small>
              </h1>
			  <ol class="breadcrumb">
				  <li><a href="home">首页</a></li>
				  <li><a href="user/list">用户</a></li>
				  <li class="active">列表</li>
			  </ol> 
			</div>
		
            <div id="page-inner"> 
               
            <div class="row">
                <div class="col-md-12">
                    <!-- Advanced Tables -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                             	用户
                        </div>
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <thead>
                                        <tr>
                                            <th>ID</th>
                                            <th>账号</th>
                                            <th>手机</th>
                                            <th>用户类型</th>
                                            <th>创建时间</th>
                                            <th>登录时间</th>
                                            <th>地址</th>
                                            <th>平台</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    	<#if users?has_content>
                                    	<#list users as user>
	                                    	<tr class="odd gradeX">
	                                            <td>${user.id}</td>
	                                            <td>${user.userName}</td>
	                                            <#if user.phone?has_content>
	                                            	<td>${user.phone}</td>
	                                            <#else>
	                                            	<td>&nbsp;</td>
	                                            </#if>
	                                            <#if user.userType==0>
	                                            <td >雇主</td>
	                                            <#else>
	                                            <td>帮手</td>
	                                            </#if>
	                                            
	                                             <#if user.createTime?has_content>
	                                            	<td>${user.createTime?string('yyyy-MM-dd HH:mm:ss')}</td>
	                                            <#else>
	                                            	<td>&nbsp;</td>
	                                            </#if>
	                                            
	                                             <#if user.loginTime?has_content>
	                                            	<td>${user.loginTime?string('yyyy-MM-dd HH:mm:ss')}</td>
	                                            <#else>
	                                            	<td>&nbsp;</td>
	                                            </#if>
	                                            
	                                             <#if user.address?has_content>
	                                            	<td>${user.address.city}-${user.address.county}-${user.address.community} </td>
	                                            <#else>
	                                            	<td>&nbsp;</td>
	                                            </#if>
	                                            <td>${user.platform}</td>
	                                            
	                                           
	                                            <td class="center">
	                                            <div class="btn-group">
												  <button class="btn btn-primary">详细</button>
												  <button data-toggle="dropdown" class="btn btn-primary dropdown-toggle"><span class="caret"></span></button>
												  <ul class="dropdown-menu">
													<li><a href="#">黑名单</a></li>
													<li><a href="#" onclick="showSetAssistantDiv(${user.id})">帮手设置</a></li>
													<#if user.userType==1>
													<li><a href="#" onclick="showAssistantAddressPanel(${user.id})">取消帮手</a></li>
													</#if>
												  </ul>
												</div>
	                                            </td>
	                                        </tr>
                                    	</#list>
                                    	</#if>
                                    </tbody>
                                </table>
                            </div>
                            
                        </div>
                    </div>
                    <!--End Advanced Tables -->
                </div>
            </div>
            
            
            <!-- 帮手服务小区 -->
            <div class="row" id="setAssistantCommunity">
               <div class="col-xs-12">					
                   <div class="panel panel-default">
                       <div class="panel-heading">
                           <div class="card-title">
                               <div class="title">添加服务小区</div>
                           </div>
                       </div>
                       <div class="panel-body">
                           <form class="form-inline">
                           	 	<input type="hidden" id="setAssistant_userId">
                               <div class="form-group">
                                   <label for="setAssistant_city">城市</label>
                                   <input type="text" class="form-control" id="setAssistant_city" name="city" placeholder="成都">
                               </div>
                               <div class="form-group">
                                   <label for="setAssistant_county">区县</label>
                                   <input type="text" class="form-control" id="setAssistant_county" name="province" placeholder="高新区">
                               </div>
                               <div class="form-group">
                                   <label for="setAssistant_community">小区</label>
                                   <input type="text" class="form-control" id="setAssistant_community" name="province" placeholder="XX小区">
                               </div>
                               <button type="button" class="btn btn-default" onclick="setAssistantCommunity()" >添加</button>
                           </form>
                       </div>
                   </div>
               </div>
           </div>
            
            <!-- 取消服务小区 -->
            <div class="row" id="removeAssistantCommunity">
               <div class="col-xs-12">					
                   <div class="panel panel-default">
                       <div class="panel-heading">
                           <div class="card-title">
                               <div class="title">取消服务小区</div>
                           </div>
                       </div>
                       <div class="panel-body">
                           <form class="form-inline">
                           	 	<input type="hidden" id="removeAssistant_userId">
                                       <div class="sub-title">服务小区</div>
                                    <div>
                                        <select class="selectbox" id="removeAssistantSelect">
                                        </select>
                                    </div>
                               <button type="button" class="btn btn-default" onclick="cancelAssistant()" >取消</button>
                           </form>
                       </div>
                   </div>
               </div>
           </div>
            
                <!-- /. ROW  -->
				<#include "/common/footer.html"/> 
        </div>
             
    </div>
             <!-- /. PAGE INNER  -->
            </div>
         <!-- /. PAGE WRAPPER  -->
     <!-- /. WRAPPER  -->
    <!-- JS Scripts-->
    <!-- jQuery Js -->
    <script src="${ctx}/assets/js/jquery-1.10.2.js"></script>
      <!-- Bootstrap Js -->
    <script src="${ctx}/assets/js/bootstrap.min.js"></script>
    <!-- Metis Menu Js -->
    <script src="${ctx}/assets/js/jquery.metisMenu.js"></script>
     <!-- DATA TABLE SCRIPTS -->
    <script src="${ctx}/assets/js/dataTables/jquery.dataTables.js"></script>
    <script src="${ctx}/assets/js/dataTables/dataTables.bootstrap.js"></script>
    <script src="${ctx}/assets/js/bxb/user.js"></script>
        <script>
            $(document).ready(function () {
                $('#dataTables-example').dataTable();
                $("#setAssistantCommunity").hide();
                $("#removeAssistantCommunity").hide();
            });
            var ctx='${ctx}';
    </script>
         <!-- Custom Js -->
    <script src="assets/js/custom-scripts.js"></script>
    
   
</body>
</html>
